{% extends 'myadmin/index.html' %}
{% block title %}
<title>用户信息</title>
{% endblock%}
{% block content %}
<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title  am-cf">文章列表</div></div>
                <div class="widget-body  am-fr">
                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                        <div class="am-form-group">
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-xs">
                                    <button type="" class="am-btn am-btn-default am-btn-success">
                                        <a href="{% url 'myadmin_user_add' %}"><span class="am-icon-plus"></span>新增</a>
                                    </button>
                
                                </div>
                            </div>
                        </div>
                    </div>
                <form>
                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
                        <div class="am-form-group tpl-table-list-select">
                            <select id="sel" name="types" data-am-selected="{btnSize: 'sm'}">
                                <option value="all" {% if request.GET.types == "all" %} selected {% endif %}>所有类别</option>
                                <option value="username" {% if request.GET.types == "username" %} selected {% endif %}>用户名</option>
                                <option value="phone" {% if request.GET.types == 'phone' %} selected {% endif %}>手机号</option>
                                <option value="email" {% if request.GET.types == 'email' %} selected {% endif %}>邮箱</option>
                                <option value="sex" {% if request.GET.types == 'sex' %} selected {% endif %}>性别</option>
                                <option value="age" {% if request.GET.types == 'age' %} selected {% endif %}>年龄</option>
                                <option value="status" {% if request.GET.types == 'status' %} selected {% endif %}>状态</option></select>
                        </div>
                    </div>
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
                        <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                            <input type="text" name="keywords" class="am-form-field ">
                            <span class="am-input-group-btn">
                                <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search" type=""></button>
                            </span>
                        </div>
                    </div>
                </form>
                    <div class="am-u-sm-12">
                        <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black ">
                            <thead>
                                <tr>
                                    <th>id</th>
                                    <th>头像</th>
                                    <th>用户名</th>
                                    <th>密码</th>
                                    <th>手机</th>
                                    <th>邮箱</th>
                                    <th>性别</th>
                                    <th>年龄</th>
                                    <th>状态</th>
                                    <th>创建时间</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                {% for i in info %}
                                <tr class="gradeX">
                                    <td>{{i.id}}</td>
                                    <td class="am-text-middle"><img src="{{i.pic_url}}" width="100"></td>
                                    <td class="am-text-middle">{{i.username}}</td>
                                    <td class="am-text-middle">******</td>
                                    <td class="am-text-middle">{{i.phone}}</td>
                                    <td class="am-text-middle">{{i.email}}</td>
                                    <td class="am-text-middle">
                                    {% if i.sex == 1 %}
                                    男
                                    {% else %}
                                    女
                                    {% endif %}
                                    </td>
                                    <td class="am-text-middle">{{i.age}}</td>
                                    <td class="am-text-middle">
                                    {% if i.status == 0 %}
                                    正常
                                    {% else %}
                                    注销
                                    {% endif %}
                                    </td>
                                    <td class="am-text-middle">{{i.addtime}}</td>
                                    <td class="am-text-middle">
                                        <div class="tpl-table-black-operation">
                                            <a href="{% url 'myadmin_user_re' i.id %}">
                                                <i class="am-icon-pencil"></i>编辑</a>
                                            <a href="{% url 'myadmin_user_dell' i.id %}" class="tpl-table-black-operation-del">
                                                <i class="am-icon-trash"></i>删除</a>
                                        </div>
                                    </td>
                                </tr>
                                {% endfor %}
                                
                                <!-- more data --></tbody>
                        </table>
                    </div>
                    <div class="am-u-lg-12 am-cf">
                        <div class="am-fr">
                            <ul class="am-pagination tpl-pagination">
                                <li class="am-disabled">
                                    <a href="?p={{pg|add:-1}}">«</a>
                                </li>
                                {% for i in pagenums %}  
                                <li {% if pg == i %} class="am-active" {% endif %}>
                                <a href="?p={{i}}&types={{request.GET.types}}&keywords={{request.GET.keywords}}">{{i}}</a>
                                </li>
                                {% endfor %}
                                <li>
                                    <a href="?p={{pg|add:+1}}">»</a>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

{% endblock %}